package com.wangmeng.book;

import com.wangmeng.book.dao.BaseDaoSupport;
import com.wangmeng.book.entity.BookDoc;
import com.wangmeng.book.job.JobExecutorHelper;
import com.wangmeng.book.job.UpdateBookListJob;
import com.wangmeng.book.server.CommandListenerServer;
import com.wangmeng.book.utils.ConstValueUtils;
import org.hibernate.engine.jdbc.BlobProxy;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.concurrent.TimeUnit;

/**
 * User: 王猛
 * Date: 13-9-10
 */
public class UpdaterMain {


    public static void main(String[] args) throws Exception {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring-config.xml");
        JobExecutorHelper.getExecutorHelper().startJobByType(ConstValueUtils.JOB_LOAD, 5, 60 * 10, TimeUnit.SECONDS);
        JobExecutorHelper.getExecutorHelper().startJobByType(ConstValueUtils.JOB_PUBLISH, 60, 60 * 10, TimeUnit.SECONDS);
        JobExecutorHelper.getExecutorHelper().startJobByType(ConstValueUtils.JOB_UPDATE, 60, 60 * 24, TimeUnit.MINUTES);
        CommandListenerServer cls = new CommandListenerServer();
        cls.run();
    }
}
